package com.chixing.service.impl;

import com.chixing.mapper.CouponMapper;
import com.chixing.service.CouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Wesley
 * @version 1.0
 * @date 2021/11/1 18:30
 */
@Service
public class CouponServiceImpl implements CouponService {
    @Autowired
    private CouponMapper couponMapper;
    @Override
    public Float getAmountById(Integer couponId) {
        if(couponId != null) {
            return couponMapper.selectByPrimaryKey(couponId).getCouponPrice();
        }else
            return 0f;
    }
}
